package com.cqrt.mapper;

import com.cqrt.dto.PlanCountDto;
import com.cqrt.dto.PlanMilestoneDTO;
import com.cqrt.entity.ChangeIssueDO;
import com.cqrt.vo.RTProjectBoardVO;
import com.hustcad.plm.pdm.type.model.vo.TypeVO;
import com.hustcad.plm.rpm.model.dto.job.TyppmJobDTO;
import com.hustcad.plm.rpm.model.entity.admin.TyppmProject;
import com.hustcad.plm.rpm.model.entity.job.TyppmJob;
import com.ty.ppm.model.entity.job.Job;
import com.ty.ppm.model.entity.plan.PlanActive;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * @Author：lotus
 * @DATE: 2025/7/15 8:53
 */
@Mapper
public interface RTProjectBoardMapper {

    @Deprecated
    List<TyppmJob> queryJobByActiveId(@Param("oidList") List<String> oidList);

    @Deprecated
    @Select("select * from TY_PROJECT where oid=#{oid}")
    TyppmProject queryProjectByOid(@Param("oid") String oid);

    BigInteger queryTypeOidByName(String name);


    List<TyppmJobDTO> queryJobByUserAndStatus(@Param("uid") String uid);

    List<TyppmJobDTO> queryNotJobByUserAndStatus(@Param("uid") String uid);

    List<TyppmJobDTO> queryNotJobByProjectOid(@Param("oidList") List<BigInteger> projectNameList,@Param("oid") BigInteger oid);

    List<TyppmProject> queryProject();

    List<RTProjectBoardVO> queryAllProject();


    List<PlanCountDto> queryProjectCountJob(@Param("oidList") List<BigInteger> projectNameList);


    List<PlanMilestoneDTO> queryPlanByMilestone(@Param("oidList") List<BigInteger> projectNameList);

    @Deprecated
    List<PlanActive> selectStagePlanById(BigInteger prj);

    @Deprecated
    @Select("select OID from TY_PJ_JOB WHERE ACTIVITYID=#{oid}")
    BigInteger selectJobById(BigInteger oid);

    List<PlanActive> selectStagePlansByIds(@Param("projectOidList")List<BigInteger> projectOidList);

    List<Job> selectJobsByIds(@Param("projectOidList")List<BigInteger> qualifiedPlanOids);

    List<Job> queryTheWaitingProjectTasks(@Param("userId")String userId);

    List<Job> myManageProjectTasks(@Param("users")List<BigInteger> userIds);

    List<ChangeIssueDO> queryIManageQuestions(@Param("userIds")List<BigInteger> userids);

    List<TypeVO> selectTypeByTypeId(@Param("typeIds")List<String> typeIds);

    //查父任务的路径
    TyppmJobDTO selectParentJobs(@Param("oid")BigInteger oid);
    //查计划名称
    String getPlanName(@Param("oid")BigInteger oid);

    List<BigInteger> getPlanOid(BigInteger oid);

}
